<div id="js-tan-bg" class="news-tan-bg"></div>
   		<div id="js-tan-box" class="news-tan-box">
	    	<span  class="zan js-news-zan-btn"><img src="<?php echo $this->_var['skins']; ?>img/icon_news_zan.png"> 赞</span>
	    	<span  class="comment js-news-comment-btn"><img src="<?php echo $this->_var['skins']; ?>img/icon_news_comment.png"> 评论</span>
	    </div>
	    <div id="js-comment-bg" class="news-tan-bg" ></div>
   		<div id="js-comment-form" class="news-comment-form">
   			<input type="hidden" id="js-comment-newsid" />
   			<div class="news-comment-content">
   				<input id="js-comment-content"    />
   			</div>
   			
   			<div id="js-comment-submit" class="news-comment-submit">评论</div>
   		</div>
   		<script>
   			 
   			var $newsid; 
   			$(document).on("click",".js-tan",function(e){
				$newsid=$(this).attr("newsid");
   				$("#js-tan-bg").show();
   				var top=e.clientY-13;
   				$("#js-tan-box").css({top:top+"px"}).show();
   			})
   			$(document).on("click","#js-tan-bg",function(){
   				$("#js-tan-box").hide();
   				$("#js-tan-bg").hide();
   			});
   			$(document).on("click",".js-news-zan-btn",function(event){
   				event.preventDefault();
   				var newsid=$newsid;
   				$("#js-tan-bg").hide();
   				$("#js-tan-box").hide();
   				var p=$("#zts"+newsid);
   				$.get("/index.php?m=news&a=zan&ajax=1&newsid="+newsid,function(data){
   					if(data.error){
   						skyToast(data.message);
   					}else{
   						if(data.data.action=='delete'){
   							$("#news-zan-"+data.data.news_zan_id).remove();
   							if(p.find("span").length==0){
   								p.hide();
   							}
   						}else{
   							p.show();
   							var z='<span id="news-zan-'+data.data.news_zan.id+'">'+data.data.news_zan.nickname+'</span>';
   							$("#zts"+data.data.news_zan.newsid).append(z);
   							p.parents(".newslist-cmbox").addClass("active");
   						}
   					}
   				},"json");
   			});
   			
   			$(document).on("click",".js-news-comment-btn",function(){
   				var newsid=$newsid;
   				$("#js-tan-bg").hide();
   				$("#js-tan-box").hide();
   				$("#js-comment-newsid").val(newsid);
   				$("#js-comment-bg").show();
   				$("#js-comment-form").addClass("top").show();
   				$("#js-comment-content").focus();
   				 
   			});
   			
   			$(document).on("click","#js-comment-submit",function(){
   				var content=$("#js-comment-content").val();
   				var newsid=$("#js-comment-newsid").val();
   				var p=$("#cms"+newsid);
   				$.post("/index.php?m=news_comment&a=save&ajax=1",{
   					content:content,
   					newsid:newsid
   				},function(data){
   					if(data.error){
   						skyToast(data.message);
   						$("#js-comment-bg").hide();
		   				$("#js-comment-form").hide();
		   				$("#js-comment-form").removeClass("top");
   					}else{
   						skyToast("评论成功")
   						$("#js-comment-bg").hide();
   						$("#js-comment-form").hide();
   						$("#js-comment-form").removeClass("top");
   						var h='<div class="cm" id="news-cm-'+data.data.id+'">'
	    					+'<span class="cm-nick">我</span>:'
	    					+content+'</div>';
	    					 
	    				$("#cms"+newsid).prepend(h);
	    				$("#js-comment-content").val("");
	    				p.addClass("active");
	    				p.parents(".newslist-cmbox").addClass("active");
   					}
   					 
   					
   				},"json");
   			});
   			
   			$(document).on("click",".js-cm-delete",function(event){
   				event.stopPropagation();
   				var id=$(this).attr("v-id");
   				var p=$(this).parents(".cm");
   				$.get("/index.php?m=news_comment&a=delete&ajax=1&id="+id,function(data){
   					skyToast(data.message);
   					if(data.error==0){
   						p.remove();
   					}
   				},"json")
   			})
   			
   			$(document).on("click","#js-comment-bg",function(){
   				$("#js-comment-bg").hide();
   				$("#js-comment-form").hide();
   				$("#js-comment-form").removeClass("top");
   			});
   			
   			$(document).on("click",".js-cm-btn",function(){
   				$newsid=$(this).attr("v-newsid");
   				var nick=$(this).attr("v-nick")
   				var newsid=$newsid;
   				$("#js-tan-bg").hide();
   				$("#js-tan-box").hide();
   				$("#js-comment-newsid").val(newsid);
   				$("#js-comment-bg").show();
   				$("#js-comment-form").addClass("top").show();
   				$("#js-comment-content").focus().val(nick);
   			})
   			
   			$(document).on("click",".js-news-follow",function(){
   				var userid=$(this).attr("userid");
   				var obj=$(this);
   				$.get("/index.php?m=follow&a=toggle&ajax=1",{t_userid:userid},function(data){
   					if(data.error){
   						skyToast(data.message);
   					}else{
   						if(data.status==0){
   							obj.html('已取消');
   						}else{
   							obj.html('已关注');
   						}
   						
   					}
   				},"json");
   			});
   			
   			$(document).on("click",".js-zhuan",function(){
   				var newsid=$(this).attr("newsid");
   				var content=$(this).attr("content");
   				var html='<textarea id="js-zhuan-content" class="news-zhuan-area">'+content+'</textarea>'
   						+'<div><button id="js-zhuan-submit" newsid='+newsid+'  class="btn btn-row">转发</button></div>'
   						;
   				showbox("转发",html,300,220);
   				$("#js-zhuan-content").focus();
   			});
   			
   			$(document).on("click","#js-zhuan-submit",function(){
   				var newsid=$(this).attr("newsid");
   				var content=$("#js-zhuan-content").val();
   				$.post("/index.php?m=news&a=save&ajax=1",{
	    				content:content,
	    				fromid:newsid
	    			},function(data){
	    				skyToast(data.message);
	    				if(data.error==0){
	    					showboxClose();
	    				}
	    		},"json");
   			})
   		</script>